/*
 * 
 * Copyright (C) 2010 Wilfried Elmenreich, Anita Sobe 
 * This file is part of VideoNetwork.
 * 
 * VideoNetwork is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. 
 */
package proxy;

public class Configuration {

	/**
	 * 
	 */
	private static int standardCapacity = 50000000; // in bytes

	/**
	 * When does the cleanup start?
	 */
	private double diskfullCleanupLimit = 0.31;


	/**
	 * 
	 */
	private int diskCapacity;
	/**
	 * 
	 */
	private boolean useLRUcleanUp;

	/**
	 * use reference model for routing
	 */
	private boolean fetchOnShortestRoute;
	/**
	 * use hormone level for prioritizing transmissions
	 */
	private boolean prioritizeTransmission;

	
	/**
	 * 
	 */
	public Configuration() {
		this(false, false, true, standardCapacity);
	}

	/**
	 * 
	 * @param capacity
	 */
	public Configuration(int capacity) {
		this(false, false, true, capacity);
	}

	/**
	 * 
	 * @param useLRUcleanUp
	 * @param fetchOnShortestRoute
	 * @param prioritizeTransmission
	 */
	public Configuration(boolean useLRUcleanUp, boolean fetchOnShortestRoute, boolean prioritizeTransmission) {
		this(useLRUcleanUp, fetchOnShortestRoute, prioritizeTransmission, standardCapacity);
	}

	/**
	 * 
	 * @param useLRUcleanUp
	 * @param fetchOnShortestRoute
	 * @param prioritizeTransmission
	 * @param capacity
	 */
	public Configuration(boolean useLRUcleanUp, boolean fetchOnShortestRoute, boolean prioritizeTransmission, int capacity) {
		this.useLRUcleanUp = useLRUcleanUp;
		this.fetchOnShortestRoute = fetchOnShortestRoute;
		this.prioritizeTransmission = prioritizeTransmission;
		this.diskCapacity = capacity;
	}

	public static int getStandardCapacity() {
		return standardCapacity;
	}

	public int getDiskCapacity() {
		return diskCapacity;
	}

	public boolean isUseLRUcleanUp() {
		return useLRUcleanUp;
	}

	public boolean isFetchOnShortestRoute() {
		return fetchOnShortestRoute;
	}

	public boolean isPrioritizeTransmission() {
		return prioritizeTransmission;
	}

	public double getDiskfullCleanupLimit() {
		return diskfullCleanupLimit;
	}

	public void setDiskfullCleanupLimit(double diskfullCleanupLimit) {
		this.diskfullCleanupLimit = diskfullCleanupLimit;
	}
}
